
<style>
.affix{top:10px;}
.head-style-list li,.editor-template-list li{cursor: pointer;}
</style>
		<div class="ui-portlet">
			<ol class="breadcrumb">
			  <li><a href="/users/index"><i class="fa fa-home"></i>&nbsp;&nbsp;{{__('Personal Center')}}</a></li>
			  <li class="active">日报管理</li>
			</ol>
		</div>           
       <hr>

{{$this->Form->create('Daily',array('class'=>'form-horizontal','role'=>'form'))}}
	<div class="form-group">
		<label class="col-sm-3 control-label" for="DailyMsgType">日报日期</label>
		<div class="col-sm-9 controls form-inline">
			{{$this->Form->input('dailydate',array('class'=>'form-control','type'=>'calendar','div'=>false,'label'=>false,))}}
		</div>
	</div>
	
	
	<div class="form-group">
		
		<div class="col-sm-12 controls">
			<p>计划事项<small style="margin-left: 20px;">（每日早间录入事项，晚间录入完成内容及完成状态）</small></p>
			<table class="table">
			<tr style="text-align:center;font-weight:bold;"><td>事项</td><td>完成内容</td><td>完成状态</td><td>操作</td></tr>
			<tr class="schedule_item"><td>{{$this->Form->hidden('Schedule.id')}}
			{{$this->Form->input('Schedule.name',array('class'=>'form-control','rows'=>3,'require'=>'require','div'=>false,'label'=>false))}}
		</td><td>
			{{$this->Form->input('Schedule.message',array('class'=>'form-control','rows'=>3,'require'=>'require','div'=>false,'label'=>false))}}
		</td><td style="vertical-align:middle;">
			{{$this->Form->input('Schedule.complete',array('class'=>'form-control','options'=>array('0'=>未完成,'1'=>已完成,'-1'=>'已取消'),'require'=>'require','div'=>false,'label'=>false))}}
		</td><td style="vertical-align:middle;">
			<a  class="btn btn-primary btn-sm bulk-add-new">新增</a>&nbsp;
			<a class="btn btn-primary btn-sm bulk-add-delete">删除</a>
		</td></tr>
			</table>
			</div>
	</div>

<div class="form-group" id="divDailySummary">
	<label class="col-sm-3 control-label" for="DailySummary">后续规划</label>
	<div class="col-sm-9 controls">
		{{$this->Form->input('followup',array('class'=>'form-control','div'=>false,'label'=>false,'rows'=>'3'))}}
	</div>
</div>
<!--
	<div class="form-group">
		<label class="col-sm-3 control-label" for="DailyName">今日规划</label>
		<div class="col-sm-9 controls">
			{{$this->Form->hidden('id')}}
			{{$this->Form->input('todayplan',array('class'=>'form-control','rows'=>3,'require'=>'require','div'=>false,'label'=>false))}}
		</div>
	</div> -->

	
	<div class="form-group" id="divDailySummary">
		<label class="col-sm-3 control-label" for="DailySummary">自我评价</label>
		<div class="col-sm-9 controls">
			{{$this->Form->input('review',array('class'=>'form-control','div'=>false,'label'=>false,'rows'=>'3'))}}
		</div>
	</div>

	
	<div class="form-group" id="divDailySummary">
		<label class="col-sm-3 control-label" for="DailySummary">意见建议</label>
		<div class="col-sm-9 controls">
			{{$this->Form->input('suggestion',array('class'=>'form-control','div'=>false,'label'=>false,'rows'=>'3'))}}
		</div>
	</div>

<div class="form-group" id="divDailyUrl">
	<label class="col-sm-3 control-label" for="DailySummary">其它记录</label>
	<div class="col-sm-9 controls">
		{{$this->Form->input('content',array('class'=>'form-control','div'=>false,'label'=>false,'rows'=>'3',))}}
	</div>
</div>
		
	
	<div class="form-group">
		<label class="col-sm-3 control-label"></label>
		<div class="col-sm-9"><input class="btn btn-primary" type="submit" value="提交"></div>
	</div>
{{$this->Form->end()}}
<script>
$(function(){
	$('.bulk-add-new').on('click',function(){
		var obj = $(this).parents('.schedule_item:first');
		obj.clone().insertAfter(obj);
		
		$('.schedule_item').each(function(i){
			$(this).find(':input').each(function(){
				var name = $(this).attr('name');
				//alert(name.replace(/\[\d*\]/,'[10]'));
				$(this).attr('name',name.replace(/\[\d*\]/,'['+i+']'));
			});
		});		
	})
	$('.bulk-add-delete').on('click',function(){
		var obj = $(this).parents('.schedule_item').remove();		
	})
})
</script>
